package com.hy.dubboconsumer.controller;

import com.hy.dubboconsumer.service.OrderService;
import org.apache.dubbo.common.stream.StreamObserver;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author: 王富贵
 * @description:
 * @createTime: 2022年10月04日 21:08:37
 */
@RestController
public class OrderController {
    @Resource
    private OrderService orderService;

    @GetMapping("/creatOrder")
    public String createOrder() {
        return orderService.createOrder();
    }

    @GetMapping("/serviceStream")
    public String getServiceStreamData(){
        return orderService.getServiceStreamData();
    }

    @GetMapping("/streamDate")
    public String getStreamObserver(){
        return orderService.getStreamData().toString();
    }
}
